<template>
  <div class="content">
    <el-button icon="el-icon-setting" @click.stop="pageSetting"> 设置</el-button>
  </div>
</template>

<script>
import PageSetting from '@/components/PageSetting/index'
import { initPageSetting } from '@/utils/table' // 表格通用方法
export default {
  name: 'SettingButton',
  props: {
    page: {
      type: Object,
      default() {
        return {}
      }
    }
  },
  methods: {
    // 刷新
    refresh() {
      this.page.refresh()
    },
    // 页面设置按钮
    pageSetting() {
      this.$layer.iframe({
        content: {
          content: PageSetting,
          parent: this,
          data: {
            pageId: this.page.pageId,
            sort: this.page.pageData,
            columns: this.page.tableColumns
          }
        },
        area: ['1200px', '600px'],
        title: '页面设置',
        resize: false,
        shade: true,
        shadeClose: true
      })
    },
    // 初始化页面设置
    initPageSetting() {
      initPageSetting(this.page)
    }
  }
}
</script>

<style scoped>
.content{
  display: inline-block;
}
</style>
